package com.citusdata.elven.feeder;

import com.citusdata.elven.feeder.CarDataFeeder;
import com.citusdata.elven.linearRoad.LinearRoadService;
import com.google.protobuf.Message;
import java.util.concurrent.Callable;


// Helper class to call linear road service concurrently.
public class LinearRoadCallable implements Callable {
  private final LinearRoadService linearRoad;
  private final Message request;

  public LinearRoadCallable(LinearRoadService linearRoad, Message request) {
    this.linearRoad = linearRoad;
    this.request = request;
  }

  public Message call() {
    Message response = CarDataFeeder.dispatchRequest(linearRoad, request);
    return response;
  }
}
